<template>
    <div>
        <el-input v-model="username" placeholder="请输入用户名" clearable></el-input>
        <el-input v-model="passowrd" placeholder="请输入密码" show-password clearable></el-input>
        <el-button type="primary" @click="login">登陆</el-button>
    </div>
</template>
<script>
import httpGet from '@/utils/http-util.js'

export default {
    name: 'login',
    data() {
        return {
            username: 'panda',
            passowrd: ''
        }
    },
    methods: {
        login() {
            console.log('login username: ' + this.username + ', pwd: ' + this.passowrd)
            sessionStorage.setItem('username', this.username)
            // httpGet('/api')
            httpGet('/api/user/get/1')
            this.$router.push({path: '/dashboard'})
        }
    },
}
</script>
<style scoped>
.el-input {
    width: 200px;
}
</style>